package com.star.uc.infras.repository.model;

import com.star.common.core.contract.BaseRepository;
import com.star.common.core.contract.Model;
import com.star.common.core.contract.enums.StatusEnum;
import com.star.uc.infras.repository.service.UserLimitCountRepository;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.time.LocalDateTime;

/**
 * 手机号、邮箱，Ip的分，时，天的限制发送数量(UserLimitCount)表实体类
 *
 * @author 周恒哲
 * @since 2023-11-01 18:17:28
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = true)
@Schema(description = "限制发送数量")
public class UserLimitCountBO extends Model {
    /**
     * 主键ID（雪花算法）
     */
    @Schema(description = "主键ID")
    private String id;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 创建人编码
     */
    @Schema(description = "创建人编码")
    private String createBy;

    /**
     * 创建人编码
     */
    @Schema(description = "创建人")
    private String creator;

    /**
     * 创建人编码
     */
    @Schema(description = "更新人编码")
    private String updateBy;

    /**
     * 创建人编码
     */
    @Schema(description = "更新人")
    private String updater;
    /**
     * 租户ID
     */
    @Schema(description = "租户ID")
    private String tenantId;
    /**
     * 限制值，ip或者邮箱或者手机号
     */
    @Schema(description = "限制值，ip或者邮箱或者手机号")
    private String limitValue;
    /**
     * 限制类型，ip-ip地址，email-邮箱，phone-手机号
     * @see com.star.uc.contract.enums.LimitTypeEnum
     */
    @Schema(description = "限制类型，ip-ip地址，email-邮箱，phone-手机号")
    private String limitType;
    /**
     * 1分钟内的限制次数
     */
    @Schema(description = "1分钟内的限制次数")
    private Integer limitMinuteCount;
    /**
     * 1小时内的限制次数
     */
    @Schema(description = "1小时内的限制次数")
    private Integer limitTimeCount;
    /**
     * 1天内的限制次数
     */
    @Schema(description = "1天内的限制次数")
    private Integer limitDayCount;
    /**
     * 状态
     * @see StatusEnum
     */
    @Schema(description = "状态")
    private Integer status;

    public static UserLimitCountRepository repository() {
        return BaseRepository.of(UserLimitCountBO.class);
    }

}

